import Character
import Wall

class GraniteWall:
	def __init__(self):
		self.instant=True
		self.sustained=True
		self.active=False
	def use(self,user):
		print 'wall of granite!'
		self.wall=Wall.Wall(height=user.getHeight())
		y=user.y
		x=user.x+0.5*user.getWidth()+1 if user.facingRight else user.x-0.5*user.getWidth()-self.wall.getWidth()-1
		self.wall.pos=(x,y)
		user.cur_room.addAnotherPlatform(self.wall)
		self.active=True
	def dispel(self,user):
		print 'no wall'
		user.cur_room.removePlatform(self.wall)
		self.wall.unboundAll()
		self.wall=None
		self.active=False